
var exportExcel=function(){
	var level = $("#chart-select").children('option:selected').val();
	var chartStyle = $("#chartStyle-select").children('option:selected').val();
	var normalType = $('#normal-select input[name="normal"]:checked').val();
	if (normalType == null) {
		normalType = 0;
	}
	getConPars(level,chartStyle,normalType);
	var flag=conditionTest(nodeStrs,fieldStrs,s_date,e_date);//数据筛选条件验证
	if(flag==true){
		doit(level,chartStyle,normalType);
	}
}

var doit=function(level,chartStyle,normalType){
	var myMask = new Ext.LoadMask(Ext.get('grid_show'), {
		msg: '正在保存，请稍后！',
		removeMask: true //完成后移除
		});
		myMask.show();
//	Ext.window.MessageBox.wait('数据导出中...');
	Ext.Ajax.request({
	    url: './excel/createExcel',
	    params: {
	    	nodeStr: nodeStrs,
	    	fieldStr: fieldStrs,
	    	s_date: s_date,
	    	e_date: e_date,
	    	nodesNames:nodesNames,
	    	tablename:tablename,
	    	level:level,
	    	chartStyle:chartStyle,
	    	normalType:normalType
	    },
	    timeout:1200000,
	    success: function(response){
	    	var flag=response.responseText
	    	if(flag=='success'){
	    		myMask.hide();
	    		window.location.href="./excel/getExcel?nodesNames="+encodeURI(encodeURI(nodesNames));
	    	}
	        // process server response here
	    },
	    
	});
}